package com.yl.drug_management.mapper;

import com.yl.drug_management.pojo.Cron;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CronMapper {
    @Select("select cron from cron order by id limit 1")
    String getCron();

    @Select("select sid from cron order by id limit 1")
    String getSid();

    @Select("select sid,cron,id from cron")
    List<Cron> selectAllCron();

    @Insert("insert into cron(sid,cron) value (#{sid},#{cron})")
    void insertCron(@Param("sid") int sid, @Param("cron") String cron);
}
